<?php
/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Kowcore
 * @copyright  Copyright KEENONWEB LLC
 * @license    http://www.keenonweb.com/
 * @version    $Id: AdminSettingsController.php 2011-03-09 08:45:41Z idris $
 * @author     Idris
 */

/**
 * @category   Application_Extensions
 * @package    Kowcore
 * @copyright  Copyright KEENONWEB LLC
 * @license    http://www.keenonweb.com/
 */

class Kowcore_AdminSettingsController extends Core_Controller_Action_Admin {
	
	public function indexAction() {
		$this->view->navigation = $navigation = Engine_Api::_ ()->getApi ( 'menus', 'core' )->getNavigation ( 'kowcore_admin_main', array (), 'kowcore_admin_main_settings' );
		
		$this->view->form = $form = new Kowcore_Form_Admin_Global ();
		
		if ($this->getRequest ()->isPost () && $form->isValid ( $this->getRequest ()->getPost () )) {
			$values = $form->getValues ();
			
			foreach ( $values as $key => $value ) {
				Engine_Api::_ ()->getApi ( 'settings', 'core' )->setSetting ( $key, $value );
			}
		}
	
	}

}